﻿#region Header

/*
Behavioral Rating of Dancing Human Crowds based on Motion Patterns
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using Sebarf.Services.Interfaces;

#endregion

namespace paravili.Services {
	/// <summary>
	/// Description of the class
	/// </summary>
	public class CurrentCaptureSourceInformationService : Service, ICurrentCaptureSourceInformationProviderService,
														  ICurrentCaptureSourceInformationLocatorService {
		#region Private Fields

		private ICaptureSource m_currentCaptureSource;

		#endregion

		#region ICurrentCaptureSourceInformationLocatorService Members

		public ICaptureSource GetCurrentCaptureSource() {
			return m_currentCaptureSource;
		}

		public event EventHandler<CaptureSourceInformationEventArgs> CurrentCaputreSourceChanged;

		#endregion

		#region ICurrentCaptureSourceInformationProviderService Members

		public void SetCurrentCaptureSource(ICaptureSource currentCaptureSource) {
			bool hasChanged = currentCaptureSource != m_currentCaptureSource;
			ICaptureSource oldCaptureSource = m_currentCaptureSource;
			m_currentCaptureSource = currentCaptureSource;
			if (hasChanged && CurrentCaputreSourceChanged != null) {
				CurrentCaputreSourceChanged(this,
											 new CaptureSourceInformationEventArgs { NewCaptureSource = currentCaptureSource, OldCaptureSource = oldCaptureSource });
			}
		}

		#endregion
	}
}